package org.zhadoop.stream.cql.semanticanalyzer.parser.visitor;

import org.antlr.v4.runtime.misc.NotNull;
import org.zhadoop.stream.cql.semanticanalyzer.parser.CQLParser.ExpressionExistsContext;
import org.zhadoop.stream.cql.semanticanalyzer.parser.CQLParser.IsNullLikeInExpressionsContext;
import org.zhadoop.stream.cql.semanticanalyzer.parser.context.EqualRelationExpressionContext;

/**
 * equal relation 表达式语法遍历
 * 
 * @author zwd
 *
 */
public class EqualRelationExpressionVisitor extends AbsCQLParserBaseVisitor<EqualRelationExpressionContext> {

	private EqualRelationExpressionContext context = null;

	public EqualRelationExpressionVisitor() {
		context = new EqualRelationExpressionContext();
	}

	@Override
	protected EqualRelationExpressionContext defaultResult() {
		return context;
	}

	@Override
	public EqualRelationExpressionContext visitIsNullLikeInExpressions(@NotNull IsNullLikeInExpressionsContext ctx) {
		IsNullLikeInExpressionVisitor visitor = new IsNullLikeInExpressionVisitor();
		context.setNullLike(visitor.visit(ctx));
		return context;
	}

	@Override
	public EqualRelationExpressionContext visitExpressionExists(@NotNull ExpressionExistsContext ctx) {
		ExpressionExistsVisitor visitor = new ExpressionExistsVisitor();
		context.setExists(visitor.visit(ctx));
		return context;
	}

}
